import 'package:flutter/material.dart';
import 'package:syria_sports/core/app_export.dart';

class DateRangePickerWidget extends StatelessWidget {
  final DateTime? startDate;
  final DateTime? endDate;

  const DateRangePickerWidget({super.key, this.startDate, this.endDate});

  @override
  Widget build(BuildContext context) {
    return Row(
      children: [
        Text('من:', style: theme.textTheme.titleLarge,),
        const SizedBox(width: 8),
        GestureDetector(
          onTap: () {
            //_showDatePicker(true);
          },
          child: Text(
            startDate != null ? _formatDate(startDate!) : 'اختر تاريخ',
            style: theme.textTheme.titleLarge!.copyWith(decoration: TextDecoration.underline),
          ),
        ),
        const SizedBox(width: 16),
        Text('إلى:', style: theme.textTheme.titleLarge,),
        const SizedBox(width: 8),
        GestureDetector(
          onTap: () {
            //_showDatePicker(false);
          },
          child: Text(
            endDate != null ? _formatDate(endDate!) : 'اختر تاريخ',
            style: theme.textTheme.titleLarge!.copyWith(decoration: TextDecoration.underline),
          ),
        ),
      ],
    );
  }

  String _formatDate(DateTime date) {
    return '${date.year}/${date.month}/${date.day}';
  }
}
